﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemCenterSoa.IRepository.SystemManager;
using SystemCenterSoa.PoModel.SystemManager;

namespace SystemCenterSoa.Service.SystemManager
{
    public class DictionariesService
    {
        private IDictionariesRepository _idictionariesRepository;
        public DictionariesService(IDictionariesRepository idictionariesRepository)
        {
            _idictionariesRepository = idictionariesRepository;
        }
        /// <summary>
        /// 根据字典类别key获取下面的字典选项
        /// </summary>
        /// <param name="typeKey">字典类别key</param>
        /// <returns></returns>
        public List<DictionariesPo> GetDictionariesKey(string typeKey)
        {
            return _idictionariesRepository.GetDictionariesKey(typeKey);
        }
        /// <summary>
        /// 分页条件查询
        /// </summary>
        /// <param name="dicName"></param>
        /// <param name="dicType"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public List<DictionariesPo> GetDictionariesList(string dicName, string dicType, int pageIndex, int pageSize)
        {
            return _idictionariesRepository.GetDictionariesList(dicName, dicType, pageIndex, pageSize);
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="dictionaries"></param>
        /// <returns></returns>
        public bool GetDictionariesAdd(DictionariesPo dictionaries)
        {
            return _idictionariesRepository.GetDictionariesAdd(dictionaries);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public bool GetDictionariesDel(string ids)
        {
            return _idictionariesRepository.GetDictionariesDel(ids);
        }
        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DictionariesPo GetDictionariesFan(int id)
        {
            return _idictionariesRepository.GetDictionariesFan(id);
        }
        /// <summary>
        /// 编辑
        /// </summary>
        /// <param name="dictionaries"></param>
        /// <returns></returns>
        public bool GetDictionariesUpdate(DictionariesPo dictionaries)
        {
            return _idictionariesRepository.GetDictionariesUpdate(dictionaries);
        }
    }
}
